package com.tiancheng.trade.settlement.controller.api;

import com.tiancheng.trade.commom.core.data.Result;
import com.tiancheng.trade.settlement.service.settlement.IPaymentBankDataCmbService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.time.LocalDate;

/**
 * 支付对账
 */
@RestController
@RequestMapping("/api/cmb")
@Slf4j
@Validated
public class PaymentBankDataCmbController {

    @Resource
    IPaymentBankDataCmbService cmbStatementUrlService;

    /**
     * 处理支付对账数据,测试,临时用
     */
    @GetMapping("/getAndSavePayCsv")
    public Result getAndSavePayCsv(@RequestParam LocalDate billDate) throws Exception {
        return Result.success(cmbStatementUrlService.getAndSavePayCsv(billDate));
    }

}
